import sys
sys.path.append('D:/tensorflow/lottery/lotto-master')
import wx
import lotter_show
import update_data as ud
import predict as pd

class MyLottery(lotter_show.MyFrame1):
    def update_history(self, event):
        self.m_staticText2.SetLabel('开始更新数据....')
        text, index = ud.update_dates()
        self.m_staticText2.SetLabel(text + '请点击开始预测按钮预测......')
        self.m_button2.SetLabel('开始预测' + str(int(index) + 1) + '期')
        self.m_textCtrl1.SetValue('5')
    def click_predict(self, event):
        self.m_staticText2.SetLabel('开始预测请稍后.....')
        num = self.m_textCtrl1.GetValue()
        if num:
            num = int(num)
        else:
            num = 5
        text = pd.predict_dlt(num)
        self.m_staticText2.SetLabel('本次预测结果如下：\n'+' '.join(text))

if __name__ == '__main__':
    app = wx.App()
    frame = MyLottery(None)
    frame.Show()
    app.MainLoop()
